﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FrameHeader.aspx.cs" Inherits="BEGDC.CC.Web.FrameHeader"
    EnableViewState="True" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title></title>
    <link href="css/global.css" rel="stylesheet" type="text/css" />
    <link href="css/header.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>

    <script language="javascript" type="text/javascript">
        $(document).ready(function() {

            var navbox = $(".navbox a");

            navbox.bind("click", function() {
                if (!$(this).hasClass("activemenu")) {

                    $(".navbox a.activemenu").removeClass("activemenu");
                    $(this).addClass("activemenu");

                    var AcceptState;

                    $.ajax({
                        type: "POST", 
                        async: false,
                        url: "FrameHeader.aspx/GetAcceptState",
                        dataType: "json",
                        contentType: "application/json; charset=utf-8",
                        success: function(result) {
                            AcceptState = result.d;
                        },
                        error: function(xhr, msg, e) {
                            AcceptState = 'UnAccept';
                        }
                    });

                    if ($(this).attr("agreement") == '' || AcceptState == 'Accept') {
                        top.mainFrame.location = "frame_main.html";
                        top.sidebarFrame.location = "FrameSidebar.aspx?c=" + $(this).attr("c");
                    }
                    else {
                        top.mainFrame.location = $(this).attr("agreement") + "?c=" + $(this).attr("c");
                        top.sidebarFrame.location = "frame_sidebar.html";
                    }
                }
            });

            navbox.first().click();
        });
    </script>

</head>
<body>
    <form runat="server">
    <div class="headerbox">
        <div class="userinfobox">
            <ul>
                <li>Welcome, <span class="username">
                    <%=LogonUserDisplayName%></span></li>
                <li class="speline">
                    <%=DateTime.Today.ToString("D", System.Globalization.CultureInfo.GetCultureInfo(1033)) %></li>
                <li class="speline" runat="server" ID="DelegateUsersLI">
                    <asp:DropDownList runat="server" ID="DelegateUsers"  AutoPostBack="True"  BackColor=#a08cd2 Width=120  />
                    </li>
                <%if (IsShowUserGuide)
                  { %>
                <li class="speline"><a href="View/MyProperty.aspx" target="mainFrame">My Property (我的属性)</a></li>
                <%} %>
                <li class="speline"><a href="logout.aspx" target="_top">Logout (注销)</a></li>
                <%if (IsShowUserGuide)
                  { %>
                <li><a href="help.html" target="mainFrame">Help (帮助)</a></li>
                <%} %>
            </ul>
        </div>
        <div class="navbox">
            <ul id="nav">
                <asp:ObjectDataSource ID="odsMenu" runat="server" SelectMethod="GetMainMenu" TypeName="ASBCC.Business.MenuHelper" />
                <asp:Repeater runat="server" DataSourceID="odsMenu" ID="MainMenu">
                    <ItemTemplate>
                        <li><a href="javascript:void(0)" title="<%#Eval("Description") %>" agreement="<%#Eval("Agreement") %>"
                            c="<%#Eval("MenuID") %>">
                            <%#Eval("Name")%></a></li>
                    </ItemTemplate>
                </asp:Repeater>
                <%--<li><a href="javascript:void(0)" title="CIS(国内)" agreement="CISAgreement.aspx" c="888">CIS</a></li>
                <li><a href="javascript:void(0)" title="CIS(海外)" agreement="CISAgreement.aspx" c="889">CIS</a></li>--%>
            </ul>
        </div>
    </div>
    </form>
</body>
</html>
